@nb-calendar-colors: 24;

.o_calendar_container {
    height: 100%;
    .o-webclient-padding(@top: @odoo-horizontal-padding/2, @bottom: @odoo-horizontal-padding/2);
    .o-flex-display();

    .calendar_color_loop(@index) when (@index < @nb-calendar-colors+1) {
        .o_calendar_color_@{index} {
            color: #0D0D0D;
            background-color: spin(rgb(255, 192, 192), 360/(@nb-calendar-colors+1) * @index);
            border-color:  spin(rgb(255, 192, 192), 360/(@nb-calendar-colors+1) * @index);
            opacity: 0.7;
        }
        .calendar_color_loop(@index + 1);
    }
    .calendar_color_loop(1);

    .underline_color_loop(@index) when (@index < @nb-calendar-colors+1) {
        .o_underline_color_@{index} {
            border-bottom: 4px solid spin(rgba(255, 192, 192, 0.7), 360/(@nb-calendar-colors+1) * @index);
        }
        .underline_color_loop(@index + 1);
    }
    .underline_color_loop(1);

    .o_calendar_view {
        .o-flex(1, 1, auto);
        min-width: 0;
        height: 100%;

        .o_calendar_widget {
            background-color: @odoo-view-background-color;
            * {
                z-index: 0; // FIXME
            }
            .fc-week-number, .fc-widget-header {
                background-color: lighten(@odoo-brand-secondary, 30%);
            }
            .o_attendee_head {
                float: right;
                margin-left: 1px;
                width: 18px;
                height: 18px;
            }
            .fc-view {
                overflow-x: auto;
            }
        }
    }

    .o_calendar_sidebar_container {
        .o-flex(0, 0, @odoo-horizontal-padding);
        position: relative;

        &.o_sidebar_hidden {
            margin-right: -@odoo-horizontal-padding; // hack to display the toggler in the gutter
            .o_calendar_sidebar_toggler {
                padding: 4px;
                color: darken(@odoo-webclient-background-color, 30%);
            }
        }

        .o_calendar_sidebar_toggler {
            .o-position-absolute(@top: 0, @right: 0);
            cursor: pointer;
            padding: 6px;
            &:hover {
                color: black;
            }
        }

        .o_calendar_sidebar {
            width: 250px;
            padding-left: 8px;
        }

        .ui-datepicker {
            width: 100%;
            font-size: 8pt;
            border-radius: 0;
            border: none;
            padding: 0;

            .ui-widget-header {
                .o-flex-display();
                background: none;
                background-color: lighten(@odoo-brand-secondary, 30%);
                border-radius: 0;

                .ui-datepicker-prev, .ui-datepicker-next {
                    .o-flex(0, 0, auto);
                    position: static;
                    cursor: pointer;
                    padding: 2px;
                    text-align: center;
                    color: @odoo-main-text-color;
                    &.ui-state-hover {
                        background: none;
                        border: none;
                        color: black;
                    }
                    .ui-icon {
                        display: none;
                    }
                }
                .ui-datepicker-prev {
                    order: 1;
                    &:after {
                        font-family: FontAwesome;
                        content: "";
                    }
                }
                .ui-datepicker-next {
                    order: 3;
                    &:before {
                        font-family: FontAwesome;
                        content: "";
                    }
                }
                .ui-datepicker-title {
                    .o-flex(0, 0, auto);
                    order: 2;
                    display: inline-block;
                    margin: 0 10px;
                }
            }
            table {
                td {
                    padding: 0 2px 2px 0;
                    background-color: @odoo-view-background-color;
                    a {
                        border: none;
                        background: none;
                        background-color: lighten(@odoo-brand-secondary, 40%);
                        text-align: center;
                    }
                }
                .ui-state-default {
                    color: @odoo-brand-primary;
                    &:hover {
                        background: none;
                        background-color: fade(@odoo-brand-primary, 50%);
                        border-color: @odoo-brand-primary;
                        color: @odoo-view-background-color;
                    };
                }
                .ui-state-active {
                    background: none;
                    background-color: @odoo-brand-primary;
                    color: @odoo-view-background-color;
                }
            }
        }
        .o_calendar_filter {
            padding: 8px;
            background: @odoo-view-background-color;
            border-top: 1px solid lightgray;
        }
    }
}

.modal {
    .o_attendee_head {
        width: 32px;
        margin-right: 5px;
    }
}

.o_dashboard {
    .o_calendar_container .o_calendar_sidebar_container {
        display: none;
    }
}
